<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="bann in banns" :key="bann.id">
      <img :src="bann.img" alt="" />
    </van-swipe-item>

    <!-- <van-swipe-item>
      <img src="../../../public/images/17.jpg" alt="" />
    </van-swipe-item>
    <van-swipe-item>
   <img src="../../../public/images/15.jpg" alt="" />
    </van-swipe-item>
    <van-swipe-item>
     <img src="../../../public/images/16.jpg" alt="" />
    </van-swipe-item> -->
  </van-swipe>
</template>

<script>
import axios from "axios";

export default {
  name:"banns",
  data(){
    return {
      banns: [],
    };
  },
  created(){


    axios({
      // url:"http://localhost:3000/bannerImgs",
      url:"/bannerImgs",
      method:"get",
      params:{},
    })
    .then((res)=>{
      this.banns=res.data;
    });
    
  }
};
</script>

<style scoped>
.my-swipe .van-swipe-item {
  width: 100%;
  height: 1.2rem;
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #fff;
  margin-top: 0.01rem;
}
img {
  width: 3.33rem;
  height: 100%;
}
</style>